class EndPortalFrameRenderer : public IBlockRenderer
{
public:
	ITexture *Texture;

	EndPortalFrameRenderer(ITexture *texture) :
		Texture(texture)
	{
	}

	int GetTypeData(const int &data) { return data; }

	void Render(Schematic *schematic, RendererBase *renderer, const Block &block, const Point3i &position)
	{
		bool filled = (block.Data & 0x04) != 0;
		byte dir = (byte)(block.Data & ~0x04);

		renderer->Translate(8, 8, 8);
		renderer->Rotate(90 * ((dir + 2) % 4), 0, 1, 0);
		renderer->Translate(-8, -8, -8);
		
		renderer->Draw(Box(Texture, Point3i(16, 13, 16), Point3i(0, 3, 0)).SetAll(Point2i(15 * 16, 9 * 16 + 3)).SetTop(Point2i(14 * 16, 9 * 16)).SetBottom(Point2i(15 * 16, 10 * 16)));

		if (filled)
			renderer->Draw(Box(Texture, Point3i(8, 3, 8), Point3i(4, 0, 4)).SetAll(Point2i(14 * 16 + 4, 10 * 16)).SetTop(Point2i(14 * 16 + 4, 10 * 16 + 4)));
	}
};